package pl.zmudzinski.jdk.newsletter.model;

import java.util.Date;
import java.text.SimpleDateFormat;

/**
 * @author lukasz.zmudzinski
 */
public class Newsletter {
    private final String message;
    private final Date date;

    public Newsletter(String message, Date date) {
        this.message = message;
        this.date = date;
    }

    public String getMessage() {
        return message;
    }

    public Date getDate() {
        return date;
    }

    @Override
    public String toString() {
        return "Newsletter{" +
                "message='" + message + '\'' +
                ", date=" + new SimpleDateFormat("m:s:S").format(getDate()) +
                '}';
    }
}
